An operating system for a computer system may have different modes of operation. For example, in a general purpose mode, an operating system may permit the execution of a wide variety of different types of applications. However, in some circumstances, a more restricted mode of operation may be useful. Once such restricted mode is often referred to as a “single function” mode which substantially restricts the behavior of the system. For example, a computer system having an operating system in a single function mode may be operated as a media player such as an MP3 (MPEG (Moving Pictures Experts Group), audio layer 3) player. In one application, unneeded devices such as networking devices may be turned off to increase battery life. Moreover, when performing as a media player, the reduced functionality of the execution mode may be “locked-down” to reduce or eliminate the capability of the system to introduce unauthorized changes or “hacks” which could be used to attempt to copy content in violation of licenses or copyright laws. Still further, such a reduced functionality may be required by a license which proscribes playing protected content in a non-controlled environment such as that provided by many general purpose operating systems.
To switch modes of operation, a computer system and its operating system are typically placed in a sleep state. In one known method, the computer system and its operating system are placed in an “S4” sleep state as defined by the Advanced Configuration and Power Interface Specification (ACPI), Rev. 3.0, published Sep. 2, 2004. In the S4 sleep state, many if not all system devices including volatile memory are powered off.
FIG. 1 shows an example of an address space 10 schematically represented by ranges 12 and 14 of memory locations. These memory locations may be within a device memory mapped input/output (MMIO) address space of a Peripheral Component Interconnect (PCI) bus, for example. In this example, context data for the current operating system environment, represented as Environment A, for the current operating system mode, resides in volatile memory in memory range 14. Thus, as the system transitions to the S4 sleep state, this context data for the current operating system Environment A residing in volatile memory is typically stored (as represented by arrow 16a) in nonvolatile storage 18 such as disk drives to preserve the context data for that Environment A while the system is in the S4 sleep state.
The context data for more than one operating system environment may be stored at one time in nonvolatile storage. Hence, as the system begins to emerge from the S4 sleep state, the context data for the intended operating system environment may be retrieved from storage 18 and loaded (as represented by arrow 16b) into the volatile memory range 14. Thus, if the context data for a single function operating system mode is loaded into volatile memory as represented by Environment B instead of the context data for a general purpose operating system mode, as represented by Environment A, the operating system may boot into the single function mode rather than resuming the general purpose mode. If so, the operation of the computer system may resume as a single purpose device rather than as a general purpose device, for example.
Once operating in the single function mode, the computer system may be returned to the general purpose mode by again placing the system in the S4 sleep mode. As the system transitions to the S4 sleep state, the context data for the current operating system Environment B residing in volatile memory is typically stored (as represented by arrow 16c) in nonvolatile storage 18 to preserve the context data for that Environment B while the system is in the S4 sleep state.
As the system begins to emerge from the S4 sleep state, the context data for the general purpose operating system Environment A may be retrieved from storage and loaded (as represented by arrow 16d) into the volatile memory. Consequently, the operating system may boot into the general purpose mode rather than the single function mode. In many known mode switching processes, a substantial length of time, such as 30-40 seconds, may be utilized to accomplish the switch from one operating system mode to another.
In many computer systems, more than one type of sleep state is often available. For example, in a computer system in accordance with the ACPI specification, in sleep states designated “S1”, “S2” or “S3”, the contents of volatile memory are maintained. In addition, in sleep states designated S2 or S3, a resume vector is maintained which directs the system, upon emerging from the sleep state, to restore certain configurations of the system which were in place prior to the system entering the S2 or S3 sleep state. Conversely, a power state designated “S5” is like sleep state S4 in that contents of volatile memory typically are not maintained. However, unlike the S4 state, operating system environment context data is generally not saved to storage. Hence, environment context data is typically lost in the S5 state.
FIG. 2 shows a prior art example of a typical system waking from states S3-S5. Upon power on (block 30), the basic input/output system (BIOS) is entered. The BIOS is built-in software which generally determines what a computer can do without accessing programs from a disk. Typically, the BIOS contains all the code for controlling the keyboard, display screen, disk drives, serial communications, and a number of miscellaneous functions. In addition, the BIOS generally makes it possible for a computer to “boot” itself, that is, start to load the first pieces of software that start a computer. Because the operating system is generally used to run the other programs, it is usually the first piece of software loaded during the boot process.
However, the boot process often depends upon the particular state from which the system is emerging. Thus, in this example, the BIOS detects (block 32) whether the suspend state was an S4 sleep state or an S5 power state. If so, the BIOS performs (block 34) a power on self test (POST) which is a diagnostic testing sequence which typically determines if the system volatile memory (such as random access memory (RAM), disk drives, peripheral devices and other hardware components are properly working. If the diagnostic determines that everything is in working order, the BIOS and the operating system will continue the boot process.
If the BIOS detects (block 32) that the suspend state was an S3 sleep state, the BIOS determines (block 36) if the currently active block or range of memory contains a valid resume vector. If so, the BIOS resumes (block 38) system booting as appropriate for resumption from an S3 sleep state. Thus, the resume vector is used to restore certain configurations of the operating system environment which were in place prior to the system entering the S3 sleep state. Absent a resume vector, the BIOS performs (block 34) a power on self test (POST) and the BIOS and operating system continue the boot process and until exiting the BIOS (block 40) leading to resumption of system operations.